package com.zhengyisky.mapper;

import com.zhengyisky.entity.Data;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DataMapper {
    @Select("SELECT id, content, create_time FROM data WHERE id >= #{startId} ORDER BY id ASC LIMIT #{batchSize}")
    List<Data> selectBatch(@Param("startId") Long startId, @Param("batchSize") int batchSize);

    @Select("SELECT MIN(id) FROM data")
    Long selectMinId();

    @Select("SELECT MAX(id) FROM data")
    Long selectMaxId();
}
